1. Field of the Invention
The present invention relates to an information recording apparatus and an information recording method using the information recording apparatus, and more particularly, to an information recording apparatus and an information recording method using the information recording apparatus that stores un-updated data in duplicate in more than two physically independent memories and thereby continues the updating processing, when data processing by one processing apparatus is stopped due to a power failure or memory failure, etc., by using un-updated data duplicated on the other processing apparatus.
2. Description of the Prior Art
A disk array apparatus writes data distributed into a plurality of disks, creates redundant data based on this data, writes this data in separate disks and thereby prevents loss of data due to disk failures. Even if a disk fails, such a disk array apparatus can restore the data as far as the level of redundancy permits and the data is not lost unless disks exceeding in number the level of redundancy fail. However, data may be lost in the case where data is not properly written in the disk, which will be described later.
Unlike a single disk, the disk array apparatus cannot perform a data write in one access. That is, the disk array apparatus requires processing in a plurality of stages such as reading old data which is originally written in the area in which data is to be written and an old parity on this old data, generating new parity data by using this data and data to be newly written and writing this data in a disk. Therefore, since the number of times in which the disk is accessed increases, which reduces the performance, a method of incorporating a cache memory in the disk array apparatus and notifying a host device of the completion of data write when a data transfer from the host device to the cache memory is completed.
In this method, the completion of data write is notified when the data transfer from the host device to the cache memory is completed, and therefore protection of data being written is an absolute condition. However, this method requires un-updated data to be held in the cache memory for a long time, which is likely to lead to data loss due to a memory failure or power failure, etc. For this reason, two control apparatuses are provided, data, which is to be processed between these apparatuses, is copied and thus data is controlled in duplicate.
Thus, providing duplicated data reduces the possibility of data being lost due to a memory failure, power failure, etc., but maintaining consistency between the data recorded in the disk and redundant data such as parity related to this data is an important element for the disk array apparatus and losing this consistency will cause wrong data to be sent to the host device.
RAID (Redundant Array of Inexpensive Disks) uses a data distribution method having several levels. For example, there are various methods, like a method called xe2x80x9clevel 3xe2x80x9d (RAID 3) in which data received from the host device is always divided into a plurality of disks, redundant data is created simultaneously with this division of data and these data items are written simultaneously as a data group whose consistency should be maintained or another method called xe2x80x9clevel 5xe2x80x9d (RAID 5) in which data is divided into sectors and written and parity information is added as another sector as in the case of normal data.
FIG. 10 illustrates an example of data arrangement on disks that make up the RAID 5. The following two methods are available as data update methods in the disk array apparatus with such disk arrangement:
(1) Method of generating parity data by reading all data groups; whose consistency should be maintained
(2) Method of generating parity data using old data Here, the case where a write to a block (Data #01) from the host device is executed will be taken as an example. In the method (1), block data (Data #09), (Data #11) and (Data #19) are read from hard disks #2, #3 and #4, respectively and new parity data is generated from these block data and content of new (Data #01) received from the host device, and the new (Data #01) and new parity data are written in hard disks #1 and #5, respectively. Furthermore, in the method (2), old data (Data #01) and old parity data are read from the hard disks #1 and #5, respectively, and new parity data is created from an exclusive OR between this old data, old parity data and new data (Data #01) received from the host device and the new (Data #01) and new parity data are written in the hard disks #1 and #5, respectively.
The same result can be obtained by using either method. According to the method (1), in the case where more new data sent from the host device is found in the data group whose consistency should be maintained, the number of times the disk is accessed can be a small number. However, in the case of access to small blocks, the greater the number of disks that make up RAID, the greater the required number of times the disk is accessed to update one block. On the contrary, in the method (2), the number of times the disk is accessed can be a small number even when access is made to a small block.
When the method (2) is used, creating new parity data requires the old (Data #01) to be finally overwritten with new data and the old parity data to be read. In this case, even if un-updated data is duplicated using the cache memories of the two control apparatuses, if processing is stopped by a power failure, etc. while one control apparatus is rewriting the old (Data #01) or old parity data, there is a possibility that wrong new parity data will be created when the other control apparatus takes over the disk data updating processing using the duplicated un-updated data. That is, when processing is stopped while un-updated data or new parity is being written in the disk and the other control apparatus takes over the processing using the duplicated data, there is a possibility that the old data and old parity necessary to generate new parity may have already been overwritten. Once these old data and old parity have been overwritten, it will no longer be possible to generate new parity using the above-described method.
According to the method (2), processing of data updating in the disk becomes irreversible upon starting a write of un-updated data or the new parity in the disk and attempting to continue the updating processing using the data duplicated by the backup control apparatus without realizing that this point of entering into an irreversible state is passed will end up losing data consistency.
It is an object of the present invention to provide a disk array apparatus that is equipped with a plurality of independent memories, protects un-updated data by maintaining duplicated data in these memories, capable of carrying out data updating without data getting garbled when one control apparatus stops processing due to a power failure, etc. during a data communication and the other control apparatus takes over this processing properly. It is another object of the present invention to provide a disk array apparatus capable of allowing logically consistent parity data to be used in the disk arrays preventing wrong data from being restored and transferred to the host device even if the disk array apparatus loses redundancy when the processing is stopped.
The information recording apparatus of the present invention is an information recording apparatus configured in such a way as to comprise a plurality of controlling means for recording data received from a host device on an information recording medium with each controlling means having memory, temporarily store the data in memory of one controlling means and at the same time store the data in duplicate in memory of the other controlling means and, when data recording processing carried out by the one controlling means is stopped, allow the other controlling means to continue the recording processing using the duplicated data and allow the other controlling means to continue processing of updating the data using the duplicated data, characterized in that a point at which the data updating processing in the one control apparatus becomes irreversible is notified from the control apparatus to the control apparatus having the duplicated data.
Thus, the disk array apparatus of the present invention allows a control apparatus that carries out data updating processing to notify a point at which processing of updating the data becomes irreversible to a backup control apparatus (other control apparatus) that stores duplicated data, and therefore when the backup control apparatus takes over the data updating processing, the backup control apparatus can recognize whether the updating processing is in an irreversible state or not and carry out processing according to the state.
More specifically, in the apparatus of the present invention, each controlling means comprises interface means for communicating with the recording medium, parity generating means for generating parity data on the data, inter-controlling-means information communicating means for communicating between control means and a parity generation disabling flag, and when the one recording means stops data recording processing, notification that the data recording processing becomes irreversible is made by setting the parity generation disabling flag in other recording means that stores the duplicated data to a parity generation disabled state.
Furthermore, in the apparatus of the present invention, each controlling means comprises interface means for communicating with the recording medium, parity generating means for generating parity data on the data and inter-controlling-means information communicating means for communicating information between the controlling means, and when the one recording means stops data recording processing, notification that the data recording processing becomes irreversible is made by storing parity data on the data to be subjected to the recording processing created by the one controlling means in the memory of the other recording means that stores the duplicated data.
Here, the point at which the data recording processing becomes irreversible is more specifically a point in time at which the data to be recorded or parity data on the relevant data is written in a recording medium and a preferred embodiment notifies the irreversible point by setting to a parity generation disabled state the parity generation disabling flag in the other controlling means that stores the duplicated data when this write is performed or by storing the parity data on the data in the other recording means that stores the duplicated data. This notification can be made to the backup controlling means (other controlling means) via inter-controlling-means information communicating means that communicates information between the controlling means.
The information recording method of the present invention is a method of controlling an information recording apparatus that records the data received from the host device on a recording medium, creates parity data on this data and records the parity data on a predetermined recording medium, configured in such way as to temporarily store un-updated data sent from the host device in memory of one of a plurality of recording medium controlling means each having memory, store the un-updated data in duplicate in the other controlling means, allow the one controlling means to create new parity data on the un-updated data from un-updated data sent from the host device, old data recorded in an area of the recording medium in which the un-updated data is to be recorded and parity data of the old data, write the un-updated data and the new parity data in a predetermined area of the recording medium, characterized in that when the one controlling means writes the un-updated data or the new parity data in the disk, the other controlling means that stores the duplicated data is notified of the point at which processing of recording the un-updated data becomes irreversible.
As described above, an irreversible point of data updating processing is a point in time at which un-updated data or new parity on this data is written in a predetermined disk. Therefore, by notifying the backup controlling means of information that this data updating processing has become irreversible when the new parity is written in the disk, the backup controlling means can take over the data updating processing according to need while recognizing whether the time at which the write processing is stopped is before or after the passing of the relevant point.
The irreversible point of the data updating processing can be notified by setting to a parity data generation disabled state the parity data generation disabling flag of the backup controlling means or copying and storing new parity data in the memory of the backup controlling means.
In this case, when the one controlling means stops data writing to the recording medium after the other controlling means that stores the duplicated data is notified of disabling of parity data re-generation, it is desirable to decide whether there is redundancy in the information recording apparatus or not, and if no redundancy is found, it is desirable that the duplicated data stored in the other controlling means be written in a predetermined recording medium and the memory of the other controlling means that stores the duplicated data store information that parity data on the data is invalid.
Such a configuration prevents parity data from being regenerated and rewritten based on data, which has lost consistency. More specifically, the information whether the new parity data is invalid or not is stored by destroying the ECC of this parity data.
Furthermore, when the one controlling means stops data writing to the recording medium after the other controlling means that stores the duplicated data is notified of parity data re-generation disabling, it is desirable to decide whether there is redundancy in the information recording apparatus or not, and if no redundancy is found, it is desirable to read the duplicated data stored in the other controlling means, generate new parity from data stored in a data recording area other than the area in which the data is to be recorded, overwrite this parity in a parity data writing area and erase the information that the parity data in memory of the controlling means is invalid.
Even if there is no redundancy in the disk array apparatus when writing is stopped, this allows correct data with consistency to be written if the condition is met.
In the case where the irreversible point of the data updating processing is notified by copying and storing new parity data in the memory of the backup controlling means, it is possible to continue write processing using the duplicated new parity even if the write processing is stopped after the irreversible point of data updating processing is passed. Therefore, even if the disk array has lost redundancy, it is possible to send correct data to the host device without losing data.